package com.dycong.common.leetcode.yi;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yilin
 * Date: 2019-08-12
 * Time: 16:13
 */
public class SingleInstance {
    private SingleInstance() {
    }

    ;

    private volatile static SingleInstance instace = null;

    public static SingleInstance getInstance() {
        if (instace == null) {
            synchronized (SingleInstance.class) {
                if (instace == null) {
                    instace = new SingleInstance();
                }
            }
        }
        return instace;
    }
}
